export function msgDostribution(res, e) {
  let chatList = uni.getStorageSync('chatList')
  if (res.content.senderId != uni.getStorageSync('userInfo').id) {
    if (res.type == 'notice-push') {
      return
    }
    if (chatList) {
      let exc = true
      chatList.forEach((item) => {
        if (res.content.senderId == item.content.senderId) {
          if (item.msgCount || item.msgCount === 0) {
            let count = item.msgCount
            res.msgCount = count + 1
            item.content = res.content
            item.msgCount = res.msgCount
          } else {
            item.content = res.content
            item.msgCount = 1
          }
          exc = false
        }
      })
      if (exc) {
        chatList.push(res)
      }
      uni.setStorageSync('chatList', chatList)
      return
    }
    res.msgCount = 1
    chatList = [res]
    uni.setStorageSync('chatList', chatList)
  }
}
